package com.itheima.yuanzixing;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo01 {
    public static void main(String[] args) {
        Song song = new Song();
        ExecutorService pool = Executors.newCachedThreadPool();
        for (int i = 0; i < 100; i++) {
            pool.submit(song);
        }


    }

}

class  Song implements Runnable{
    public volatile int count=0;


    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
           count=count+1;
            System.out.println("已经送了"+count+"个");
        }
    }
}
